package com.jiyi.activity;

import android.os.Bundle;
import android.view.View;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.widget.TextView;

import com.swift.base.ActivityBase;
import com.swift.maintenance.R;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class AboutMeActivity extends ActivityBase {
	@BindView(R.id.wv_about_me)
	WebView mWebView;
	private static final String APP_CACHE_DIRNAME = "/webcache";

	@BindView(R.id.tv_toolbar_title)
	TextView tvTitle;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_about_me);
		ButterKnife.bind(this);
		tvTitle.setText("关于我们");
		initView();


	}

	private void initView() {
		WebSettings webSettings = mWebView.getSettings();
		webSettings.setUseWideViewPort(true);
		webSettings.setLoadWithOverviewMode(true);

		//设置缓存的大小
		webSettings.setAppCacheMaxSize(10 * 1024 * 1024);
		String appCacheDir = this.getApplicationContext().getDir("cache", this.MODE_PRIVATE).getPath();
		webSettings.setAppCachePath(appCacheDir);
		// 设置可读取的文件
		webSettings.setAllowFileAccess(true);
		mWebView.loadUrl("http://www.jyfire.cn/about1.html");

	}

	@OnClick({R.id.iv_toolbar_back})
	public void onClick(View view) {
		switch (view.getId()) {
			case R.id.iv_toolbar_back:
				finish();
				break;
		}
	}
}
